package com.example.wallpaperapp.bean;

import android.app.Service;
import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 */
public class Moment implements Parcelable,Serializable {
    public String content;
    public ArrayList<String> photos;
    public String likeNum;
    public String userName;
    public String UserPhoto ;
    public String commentNum;

    public Moment(String userName, String userPhoto,String content, ArrayList<String> photos, String likeNum,  String commentNum,int userId) {
        this.content = content;
        this.photos = photos;
        this.likeNum = likeNum;
        this.userName = userName;
        UserPhoto = userPhoto;
        this.commentNum = commentNum;
    }
    public Moment(String userName, String userPhoto,String content, ArrayList<String> photos, String likeNum,  String commentNum) {
        this.content = content;
        this.photos = photos;
        this.likeNum = likeNum;
        this.userName = userName;
        UserPhoto = userPhoto;
        this.commentNum = commentNum;

    }
    @Override
    public int describeContents() {
        return 0;
    }
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.content);
        dest.writeString(this.likeNum);
        dest.writeStringList(this.photos);
        dest.writeString(this.userName);
        dest.writeString(this.UserPhoto);
        dest.writeString(this.commentNum);
    }

    public Moment() {
    }
    public Moment(String content, ArrayList<String> photos) {
        this.content = content;
        this.photos = photos;

    }
    public Moment(String content, ArrayList<String> photos,String likeNum) {
        this.content = content;
        this.photos = photos;
        this.likeNum = likeNum;
    }

    protected Moment(Parcel in) {
        this.content = in.readString();
        this.photos = in.createStringArrayList();
        this.likeNum = in.readString();
    }

    public static final Parcelable.Creator<Moment> CREATOR = new Parcelable.Creator<Moment>() {
        @Override
        public Moment createFromParcel(Parcel source) {
            return new Moment(source);
        }

        @Override
        public Moment[] newArray(int size) {
            return new Moment[size];
        }
    };
}